<?php
/**
 * Created by PhpStorm.
 * User: yangsen
 * Date: 15/6/30
 * Time: 下午4:33
 */

class Member extends CI_Model {
    public function __construct() {
        parent::__construct();
        $this->load->database();
    }

    public function getUserInfoFromDb($openid) {
        $userinfo = $this->db->get_where('t_user',array('openid'=>$openid),0,1);
        $userinfo = $userinfo->result('array');
        //var_dump($userinfo);
        if(empty($userinfo)) {
            return null;
        } else {
            return $userinfo[0];
        }
    }

}